home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Media 22
/
PC MEDIA CD22.iso
/
share
/
prog
/
spm220e
/
testmodp.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-09-01
|
2KB
|
69 lines
{
╔═════════════════════════════════════════════════════════════════════════════╗
║ NAME : TESTMODP.PAS ║
║ FUNCTION : A simple demo. of how to use MODEM.PAS... ║
║ COPYRIGHT : HETRU Fabrice 1991-1995. ║
╚═════════════════════════════════════════════════════════════════════════════╝
}
USES Crt,Dos,StarIntf,Modem;
VAR
Key,car : CHAR ;
InBuffSz,
OutBuffSz,
fmt,Nb,NbR : WORD ;
Result : BYTE ;
BEGIN
WRITELN('HAYES modem testing using the PASCAL interfacing.');
(* Set this variable to 0 for COM1:...to 7 for COM8: *)
CommPort := 0;
IF type_driver<>0 THEN
BEGIN
CheckBreak := FALSE;
Init_status(fmt);
Result := Init_Port('7','1','N',2400,InBuffSz,OutBuffSz);
Result := Open_Port;
Show_CorF := TRUE;
GetIntVec($1C,Int1CSave);
SetIntVec($1C,Addr(Check_HModem_State));
WRITELN('<I>nitialize <C>onnect <H>ang-off Q==>QUIT');
REPEAT
Key := ' ';
IF KeyPressed THEN
BEGIN
Key := UpCase(ReadKey);
IF (Key=#0) AND KeyPressed THEN Key := ReadKey;
CASE Key OF
'I': CmdeToModem(InitMod,'');
'C': CmdeToModem(Connect,'');
'H': CmdeToModem(Raccroch,'');
#59: WRITELN('<I>nitialize <C>onnect <H>ang-off Q==>QUIT');
END;
END;
IF CheckBufferIn(Nb) THEN
BEGIN
Result := ReadSerie(car,1,NbR);
IF Result=0 THEN WRITE(car);
END
UNTIL Key='Q';
IF MEM[$40:$49] IN [2,3,7] THEN
MEMW[seg_ecran:158] := $0720
ELSE MEMW[seg_ecran:76] := $0720;
SetIntVec($1C,Int1CSave);
Result := Reset_Init_status(fmt);
IF WhereX>1 THEN WRITELN;
IF Close_Port(TRUE)<>0 THEN WRITELN('Port NOT closed !');
WRITELN('Test has terminated.');
END
ELSE WRITELN('Please, load STARCOMM.EXE...');
END.